<template>
  <div class="qrcode">
  	<h3>支付码</h3>
    <p>_uniqueid：{{value._uniqueid}}</p>
    <p>poi_id:{{value.poi_id}}</p>
    <img :src="qrcode">
  </div>
</template>
<script type="text/javascript">
export default {
  components: {

  },
  props: {
    value: [Array, Object]
  },
  data() {
    return {
      isLoading: false,
      qrcode: ''
    };
  },
  /**
   * 页面渲染前
   * @return {[type]} [description]
   */
  created() {

  },
  /**
   * 计算属性
   * @type {Object}
   */
  computed: {
    url() {
      return this.$cloud.AppURL + '/' + this.$cloud.AppID + '/ticket' + `?mid=${this.value._uniqueid}&poi_id=${this.value.poi_id}&id=${this.value._id}`;
    }
  },
  /**
   * 页面加载执行
   * @return {[type]} [description]
   */
  mounted() {
    this.$cloud.tools().qrcode(this.url).then(data => {
      this.qrcode = data;
    });
  },
  methods: {
    affirm(e) {
      let { handleCancel } = e;
      handleCancel();
    }

  }
};

</script>
<style lang="less" scoped="true">
.qrcode {
  text-align: center;
}

</style>
